import 'package:json2dart_safe/json2dart.dart';

class EngagementModel {
  String? cityName; //所属城市
  String? createdAt;
  String? info; //详情简介
  String? logo; //头像
  int? meetType; //楼凤类型：1-外围 2-楼凤
  int? meetUserId; //楼凤用户id。唯一
  String? nickName; //用户昵称（标题）
  double? nightPrice; //包夜价（例：2000/包夜）
  bool? officialCert; //官方认证
  double? price; //单价(例：1200/P 300/小时)
  String? priceDel; //消费价格描述
  List<String>? serviceTags; //服务标签
  String? updatedAt; //更新时间
  bool? videoCert; //是否视频认证

  EngagementModel({
    this.cityName,
    this.createdAt,
    this.info,
    this.logo,
    this.meetType,
    this.meetUserId,
    this.nickName,
    this.nightPrice,
    this.officialCert,
    this.price,
    this.priceDel,
    this.serviceTags,
    this.updatedAt,
    this.videoCert,
  });

  Map<String, dynamic> toJson() {
    return <String, dynamic>{}
      ..put('cityName', cityName)
      ..put('createdAt', createdAt)
      ..put('info', info)
      ..put('logo', logo)
      ..put('meetType', meetType)
      ..put('meetUserId', meetUserId)
      ..put('nickName', nickName)
      ..put('nightPrice', nightPrice)
      ..put('officialCert', officialCert)
      ..put('price', price)
      ..put('priceDel', priceDel)
      ..put('serviceTags', serviceTags)
      ..put('updatedAt', updatedAt)
      ..put('videoCert', videoCert);
  }

  EngagementModel.fromJson(Map<String, dynamic> json) {
    cityName = json.asString('cityName');
    createdAt = json.asString('createdAt');
    info = json.asString('info');
    logo = json.asString('logo');
    meetType = json.asInt('meetType');
    meetUserId = json.asInt('meetUserId');
    nickName = json.asString('nickName');
    nightPrice = json.asDouble('nightPrice');
    officialCert = json.asBool('officialCert');
    price = json.asDouble('price');
    priceDel = json.asString('priceDel');
    serviceTags = json.asList<String>('serviceTags');
    updatedAt = json.asString('updatedAt');
    videoCert = json.asBool('videoCert');
  }

  static EngagementModel toBean(dynamic json) => EngagementModel.fromJson(json);
}
